import datetime

from influxdb import InfluxDBClient

def generate_data():
    template = "insert into CG,{} {}"
    fields = dict(key1=1,key2=2,key3=3,time='2023-02-15T15:56:20Z')

    body = dict(
        measurement="CG",
        fields=fields
    )
    return body

client = InfluxDBClient(host="localhost", port=8086, username="root", password="BICI123456", database="bfbd2022")

for i in range(100):
    data = generate_data()
    client.write_points([data])
